473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Wrap content in a <tr> tag to a new line

I cant figure out how to wrap the content to a new row when it exceeds the width of the page?

Here is a link to what I have so far and the first question in this survey has more color swatches than is visible. I need these color chips to move to a new line so that they are all visible.

http://www.colormatters.com/component/surveys/1-color-survey/2/editsurvey?Itemid=794

Here is what I have:

Expand|Select|Wrap|Line Numbers
  1. $return .= '<table class="table_question">';
  2.         $return .=       '<tr>';
  3.         $return .=            '<td class="'.$question_class.'">';
  4.         $return .=           $question_details["0"]["title"];
  5.         if($question_details["0"]["required"] == "1"){
  6.             $return .= '<span class="question_required"> *</span>';
  7.             $javascript = ' onchange="setentertext(form.q'.$question_id.', this)" ';
  8.             $validation = $this->createValidation($question_id, $question_details["0"]["title"]);                    
  9.         }
  10.         $return .=            '</td>';
  11.         $return .=       '</tr>';
Nov 29 '11 #1
4 2076
Frinavale
9,735 Expert Mod 8TB
Create a row with one table data "<td>" element for where you want the wrapping to occur.

Your items should wrap.

-Frinny
Nov 29 '11 #2
drhowarddrfine
7,435 Expert 4TB
I'd bet he wants it to wrap as the browser is resized and that's not going to happen. Reason #9736 why you should never use tables for layout.
Nov 29 '11 #3
johny10151981
1,059 1GB
you should also take a look at css property overflow
Nov 30 '11 #4
omerbutt
638 512MB
hi ,
you can use jquery to get the body / screen width on run time
Expand|Select|Wrap|Line Numbers
  1. var dimX    =    $(document.body).width();
  2. var dimY    =    $(document.body).height();
  3.  
and assign that width to the table or td to go on with the
screen resolution , i dont think it is impossible to do drhowarddrfine that you go bet on it ;)
regards,
Omer Aslam
Dec 1 '11 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: John Geddes | last post by:
In both IE6 and Netscape 7: insertRow method of tbody is behaving as expected: - inserts a new row - increases tbody.rows.length BUT deleteRow is not doing the opposite. It DOES delete the...
7
by: F. Da Costa | last post by:
Hi, I' looking to retrieve ProdName1 form the <tr> below. <tr id="1-1-1" class="even"> <td> <div class="tier4"> <a href="#" class="leaf"></a> ProdName1 </div>
18
by: Shannon Jacobs | last post by:
Trying to solve this with a regex approach rather than the programmatic approach of counting up and down the levels. I have a fairly complicated HTML page that I want to simplify. I've been able to...
4
by: El Diablo | last post by:
Hi there, I'm trying dynamically generate extra rows in a table. So far this achieves this task within the tHead segment: theTable.tHead.appendChild(document.createElement('TR')) ....but...
1
by: prefersgolfing | last post by:
I'm not using Master Pages, yet I'd like to display the contents of an HTML page within a <table><tr><td> on a .aspx. I have a lengthy guide already paginated in html. I'd like to embed the...
2
by: petereffect | last post by:
i have foll. code <tr> <a href="a1.shtml"> <td width='100%'> &nbsp;"+Testing+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td> </a>
5
by: mahesr | last post by:
I want to match some particular text between <tr>and </tr> or <td>and </td>.... in PHP. like below............ <table><tr> CATEGORY: <td><font face="Verdana" size="1" color="#A000A0"> Wedding...
7
by: Xiaoyan | last post by:
Hi,everyone: I have a problem now. I can't get the information between the <tr><td> and </td></tr>. for example: I use this regular expression can't get it, I don't know why....
4
by: monion | last post by:
All, One more question (never ending right???) If I have a list of names to pull from (Mitch, Bob, Randy, Simon, Paul & Will) in a MYSQL database. How can I query them into a web page using...
4
by: ismailc | last post by:
Good day, RamananKalirajan helped me with a great script to do a popup div. The problem i now have is that the popup div within the div does not like any table><tr><td>, so itried using <div> in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.