Jump to content

how to give a table same width?...


rootKID
 Share

Recommended Posts

hello again...i have been thinking, when im making a table, lets say 100% to fill out the div i just gave, it DOES go out.. but when i have like 3 td's to fill out, it keeps pushing to the other site.... i would like it like shown below: PICTURE ATTACHED in the picture you can see however much text you now put in, the boxes still have the same width.. is that a normal css class editing with width?, or some sort of speciel method you guys use?... Hoping you understood what i said, had a little bit trouble explaining about it, lol X)...

Link to comment
Share on other sites

If I understand correctly your table is pushing out beyond the div or design. Since the table is set for 100% you will need to define one row of cells so that it does not go beyond the desire framework. Based on your image you have 5 cells. Set the first row of cells with a set width for each. Use the table header cell ( th ). In your case something like this:

 <table style="width:100%"><tr>  <th style="width: 8%;">P_ID</th>  <th style="width: 23%;">FirstName</th>  <th style="width: 23%;">LastName</th>  <th style="width: 23%;">Address</th>  <th style="width: 23%;">City</th></tr><tr>  <td>data here</td>  <td>data here</td>  <td>data here</td>  <td>data here</td>  <td>data here</td></tr></table>

Edited by newseed
Link to comment
Share on other sites

  • 2 weeks later...

hmm, sorry for late reply, thanks. will test later to see if it will work correctly x)...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...