Jump to content

Table Width


mickeymouse
 Share

Recommended Posts

W3Schools says "If the width attribute is not set, a table takes up the space it needs to display the table data. Problem: I have no width attribute but the width displayed is only a bit more than the screen width and it takes 3 rows to display the data instead of displaying all in one row. I do not have a CSS defining the width. If I define the width in the table tag as width="5000", my data iscorrectly displayed in one row. But I don't want to use this methodbecause the length of my row is variable from one user to another.

Link to comment
Share on other sites

Tried it but doesn't work.Is this what you meant?<input readonly size=\"10\" style=\"white-space:nowrap;color:maroon;text-align:left\" value=\"Date\"><input readonly size=\"33\" style=\"white-space:nowrap;color:maroon;text-align:left\" value=\"Description\"><input readonly size=\"10\" style=\"white-space:nowrap;color:maroon;text-align:right\" value=\"Amount\"> <input readonly size=\"15\" style=\"white-space:nowrap;color:maroon;text-align:left\" value=\"From Account\"><input readonly size=\"15\" style=\"white-space:nowrap;color:maroon;text-align:left\" value=\"To Account\">

Link to comment
Share on other sites

Hi mickeymouse,Could you please show me your design? I would like to know why and where have you used width="5000"...

Link to comment
Share on other sites

Just CSS:
td {   white-space: nowrap}

Hi Ingolme,What is this used for? How can I use this in DIV tags? Could you please show me an example? I have never used it.
Link to comment
Share on other sites

Hi Ingolme, What is this used for? How can I use this in DIV tags? Could you please show me an example? I have never used it.
All it does is prevent text from wrapping in an element. You can use it on any element.
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...