Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6816417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:55:24+00:00 2026-05-26T20:55:24+00:00

More of a stylistic question really, but how do you mix HTML tabs with

  • 0

More of a stylistic question really, but how do you mix HTML tabs with scripting logic tabs in your source code? That might not be the best way to state the question, but I think a simple example will demonstrate it well. Note the tabbing:

<table>
    <tr><td>This is the first row</td></tr>
    <? if ($test == true) { ?>
        <tr><td>Only display the second row if some test is true</td></tr>
    <? } ?>
</table>

vs

<table>
    <tr><td>This is the first row</td></tr>
    <? if ($test == true) { ?>
    <tr><td>Only display the second row if some test is true</td></tr>
    <? } ?>
</table>

I know in PHP you can be crafty with the if syntax and do “if(something):” and then do an “endif;” later. But it amounts to the same thing.

Should your code tab based on the HTML or based on the logic conditions. I ask this because I am working on a project (not in PHP, but similar scripting language) where there is no MVC, so there are loads of logic mixed in with the HTML and it can get quite messy in terms of the tabs. If you tab based on both your code ends up too far from the left-margin. Are there any standards to follow here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T20:55:25+00:00Added an answer on May 26, 2026 at 8:55 pm

    There’s no set standard, but I’d say that properly tabbed PHP code files is more important than properly tabbed HTML. You’re going to be spending significantly more development time reading the PHP than the HTML source.

    The other solution is to use buffered output with ob_start() and have the HTML code “prettified” before it gets written out to the page, so you get both. But that might make your code more confusing, so it’s probably not worth the effort.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think this is more a stylistic question, but I have a class with
More of a theoretical question, but wouldn't it make more sense to have only
I have a stylistic question, really. I am wondering which is the best, fastest,
More than one time I have encountered the following problem when building code with
More of a general MATLAB question than looking for programming advice -- if I
More of a design/conceptual question. At work the decision was made to have our
More of reflection that a problem . Im creating a stored procedure that takes
This is a random question that came to me, obviously I wouldn't want to
More specifically the STM32F107 . I could barely find any code on ST's website,
More of an architecture / long-term view question. I'm in the process of putting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.