Solved

Align tablecell controls

Posted on 2007-03-27
3
1,202 Views
Last Modified: 2008-01-09
Hi experts.

Does anyone know how to align tablecell controls horizontally using .net (VB)? i have a table cell containing two controls : a time picker and a date picker (could not find a composite control?) and would like them to appear side by side in the cell.  Would prefer not to create another table column for appearance sake and there does not seem to be a way to split a cell?

Many thanks
0
Comment
Question by:jeanniex
  • 2
3 Comments
 
LVL 3

Expert Comment

by:Saber37886661
ID: 18805328
you can try and set the table cells HorizontalAlign to HorizontalAlign.Center.
It will probably not put them side to side though, so likely you will have to wrap them in another table, but if the tables border, cellpadding and cellspacing is set to '0' then the table is not visible and it will not affect your layout.

Hope it helps
0
 
LVL 1

Author Comment

by:jeanniex
ID: 18807474
Hi.

The horizontal alignment option does not work - nor combining this with "wrap" = false.
If I put another table in the cell and add a row to this with two cells - putting one control in each, they do appear side by side but not aligned horizontally.  Modifying the horizontalalignment of these tablecells does not seem to have the desired result either.
I am doing this in VB and not in the design view as I need to be able to add rows dynamically.
Any ideas?
thanks in advance
0
 
LVL 3

Accepted Solution

by:
Saber37886661 earned 500 total points
ID: 18809466
If it helps, I always do mine in the editor/ code view and never the design mode, lol it always crashes my copy of visual studio! (even after the 255th re-install)
for me i just go:
Dim tab As New Table
Dim tr As New TableRow
Dim tc As New TableCell
tc.HorizontalAlign = HorizontalAlign.Center

but normally in c# (its alot easier in c#, the language structure is more logical(wait for the comments on that comment of mine!))

ok how about giving the table cells a CssClass, eg:
tc.CssClass() = "tdAlign"
then in your css just add
.tdAlign
{
     white-space:normal;
     text-align: center;
}
or you could add it to the top of your page.
<style>
.tdAlign
{
     white-space:normal;
     text-align: center;
}
</style>

if none of this helps, let me know, but for now, its bed time
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Foreword (May 2015) This web page has appeared at Google.  It's definitely worth considering! https://www.google.com/about/careers/students/guide-to-technical-development.html How to Know You are Making a Difference at EE In August, 2013, one …
Introduction A frequently used term in Object-Oriented design is "SOLID" which is a mnemonic acronym that covers five principles of OO design.  These principles do not stand alone; there is interplay among them.  And they are not laws, merely princ…
This video teaches users how to migrate an existing Wordpress website to a new domain.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…

895 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now