Solved

<th> tag -- I want to align the text left

Posted on 2013-01-24
2
408 Views
Last Modified: 2013-01-24
Using jQuery, I want to align the indicated <th> tag to the left  (right now it is centered)

<th scope="col">Details</th>



Here is the code segment:

<table class="grid_view" cellspacing="0" id="ctl08_gvRepairItems" style="width:300px;border-collapse:collapse;">
		<tbody><tr class="grid_view_header">
			<th scope="col">&nbsp;</th><th scope="col">Repair Item</th><th scope="col">Units</th>







\\\\\\\\\\\  right now this is centered, I want to align it to the LEFT

<th scope="col">Details</th>







		</tr><tr id="ctl08_gvRepairItems_ctl02" onclick="HighLightGVRow('ctl08_gvRepairItems_ctl02', 'ctl08_gvRepairItems_ctl02_hdSelectedRow', 'ctl08_gvRepairItems_ctl02_hdOldStyle');">
			<td style="width:100px;">
                                            <a id="ctl08_gvRepairItems_ctl02_lnkDelete" href="javascript:__doPostBack('ctl08$gvRepairItems$ctl02$lnkDelete','')" style="display:inline-block;width:40px;">Delete</a>
                                        </td><td>
                                            <span id="ctl08_gvRepairItems_ctl02_lblRepairItem">Carpet Cleaning</span>
                                        </td><td>
                                            <span id="ctl08_gvRepairItems_ctl02_lblUnits">SF</span>
                                        </td><td>
                                            <span id="ctl08_gvRepairItems_ctl02_lblDetails" style="display: inline-block; width: 800px; text-align: left;">asfasd</span>
                                        </td><td><input type="hidden" name="ctl08$gvRepairItems$ctl02$hdSelectedRow" id="ctl08_gvRepairItems_ctl02_hdSelectedRow"><input type="hidden" name="ctl08$gvRepairItems$ctl02$hdOldStyle" id="ctl08_gvRepairItems_ctl02_hdOldStyle"></td>
		</tr>
	</tbody></table>

Open in new window

0
Comment
Question by:knowlton
2 Comments
 
LVL 8

Accepted Solution

by:
soupBoy earned 500 total points
ID: 38815895
$('.grid_view_header th:eq(3)').css({
    textAlign: 'left'
});

Open in new window


All this is doing is injecting inline styles....you can do this with css too, which would be a better way to do it....
0
 
LVL 5

Author Closing Comment

by:knowlton
ID: 38815911
This worked perfectly!

Thanks,

Tom
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question