www.webdeveloper.com
Results 1 to 5 of 5

Thread: Hidin/Displaying content

  1. #1
    Join Date
    Jul 2014
    Posts
    1

    Unhappy Hidin/Displaying content

    hi Quick question,

    I have write all code in the same page.. that means page1.html, page2.html.. I have configure all in the one page i.e first.html... now how I load appropriate page ?

    Here is my code.. I have table1.html and table2.html on the same page.. how I can hide table2 two while displaying table1...

    -- This is table1.html
    <html>
    <body>
    <select>
    <option value="table1">table1</option>
    <option value="table3">table2</option>


    </select>
    <div id="body-container" style="width:80%;margin-left:auto;margin-right:auto;">
    <h1> <center> Table 1 body</center></h1>
    <table border = 1px width="600">
    <tr>
    <td>1</td>
    <td>11</td>
    <td>111</td>
    <td>1111</td>
    </tr>
    <tr>
    <td>2</td>
    <td>22</td>
    <td>222</td>
    <td>2222</td>
    </tr>

    </table>
    </div>
    <button type="button">Export Table1!</button>
    <br><br><br>
    </html>
    -This is table3 body
    <html>
    <body>
    <select>
    <option value="table1">table1</option>
    <option value="table2">table3</option>

    </select>
    <div id="body-container" style="width:80%;margin-left:auto;margin-right:auto;">
    <h1> <center> Table 3 body</center></h1>
    <table border = 1px width="600">
    <tr>
    <td>1</td>
    <td>11</td>
    <td>111</td>
    <td>1111</td>
    </tr>
    <tr>
    <td>2</td>
    <td>22</td>
    <td>222</td>
    <td>2222</td>
    </tr>

    </table>
    <button type="button">Export Table2!</button>
    <br><br><br>
    </div>
    </body>
    </html>


    Thanks for your help in advanced

  2. #2
    I can't quite figure out what you are actually asking -- I suspect language barrier is the issue on that as your post is incomprehensible... Is there a question in there somewhere?

    But on your code, why are you using form elements without a form? Why are you using tags like CENTER that have no business on any page written after 1997? Why are you using the STYLE attribute? Where's your TBODY? Where's your THEAD filled with TH and SCOPE so people know what your columns are? Why are you using H1 to do what looks like should be CAPTION's job? Why are you using line-breaks to do padding's job? What's with the invalid border declaration on TABLE?

    No offense, but your HTML makes about as much sense as your English.

  3. #3
    Join Date
    Mar 2012
    Posts
    1,753
    @jenxyz

    Please do not attach your post to an unrelated thread. I've moved it here as a separate thread.

    @deathshadow

    I think he wants to hide/display tables according to the select setting. I'd do it with PHP dynamically writing ""display:none" on one or other table's CSS style. It's clunky but would work. Do you have a better idea?
    Last edited by jedaisoul; 07-27-2014 at 04:38 PM.

  4. #4
    Better Idea? Yeah, make them separate pages and use anchors to navigate between them. Don't take something simple and make it hard. Don't send data client-side the user might not even visit. Don't waste scripting when you don't need scripting...

    ... and if semantic markup, minimalist markup and separation of presentation from content can be used to leverage caching properly, depending on the number of rows of data in the live copy it could load as fast and as smooth as AJAX... It's why the whole "use scripting to make it faster" nonsense usually makes me laugh...

    ... since throwing more code at it is usually NOT the answer.

  5. #5
    Join Date
    Mar 2012
    Posts
    1,753
    @jenxyz

    Is there a reason why you want the two tables on the same page?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles