Horizontal Rule in HTML Markup

1 Answer 65 Views
Label
Michael
Top achievements
Rank 1
Michael asked on 30 Oct 2023, 07:21 PM

Is it possible to mimic an <hr> tag in the Html markup functionality?  Trying to create dividers in the RadLabel control.  Has anyone implemented something similar?

Thanks!

1 Answer, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 31 Oct 2023, 11:09 AM

Hello Michael,

Thank you for reaching out to us.

The <hr> tag is not one of the supported tags. The full list of the supported tags can be found in the HTML-like Text Formatting help article in our documentation. As for your scenario, can you share an image of what you are trying to achieve so that I can try to find a possible way to achieve it?

Regards,
Dinko | Tech Support Engineer
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Michael
Top achievements
Rank 1
commented on 31 Oct 2023, 12:49 PM

Here is a screenshot of a mockup that was provided. The lines might be a little faint, but they're there in the right-hand panel.
Dinko | Tech Support Engineer
Telerik team
commented on 01 Nov 2023, 09:02 AM

Thank you for the provided details. I see what you are trying to achieve. However, as the <hr> tag is not supported you will need to somehow simulate such a line. What comes to my mind is to use span, for example, with long dash symbols, and style it per your needs. The tricky part here is the length of the span. So far I could not find a way to stretch the span to fit the width. So you will need to manually type the dash symbols to fit the width of the panel. Here is an example:

this.radLabel1.Text = "<html>\r\nThe Main Languages of the Web\r\n<p>HTML is the standard markup language for creating Web pages. HTML describes the structure of a Web page, and consists of a series of elements. HTML elements tell the browser how to display the content.</p>\r\n<span style=\"color:gray\">----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>\r\n<p>CSS is a language that describes how HTML elements are to be displayed on screen, paper, or in other media. CSS saves a lot of work, because it can control the layout of multiple web pages all at once.</p>\r\n<hr>\r\n<p>JavaScript is the programming language of HTML and the Web. JavaScript can change HTML content and attribute values. JavaScript can change CSS. JavaScript can hide and show HTML elements, and more.</p>\r\n</html>";

And the result:

There could be a better way to simulate this using HTML. That is why I would recommend searching the web if there is a more generic way to draw a line in a string.

I hope you find my reply helpful.

 

Tags
Label
Asked by
Michael
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or