Can someone explains what is the best way of splitting RTE content text in 2 seperate div container ?
Since am working with a very long text container we would like to trim 0-450 characters in one div container and from 451 - 950 in another div container.
Pretty hard to split HTML in 2 equal parts, but one thing is for sure: Substring won't be your friend here ;-)
What's your browser requirement? Because you could easily achieve this with CSS columns (browser support). See here for introduction.
In case you need to split it without CSS, you will need a RegEx or parse the entire HTML (I would prefer RegEx).
The problem with both solutions is, that it's pretty impossible to split exactly it char 450, because this char could be a tag itself?! Or it could be text within a tag. So if you split it, you will have to close the tag and re-open it in the next part again.
That's why I think CSS columns are the best solution here, as the browser can handle it itself.
True splitting those RTE content not very handy and practical. But yes i will give a try to css columns the only thing is IE not supporting it properly.
Splitting content in 2 different container
Hi,
Can someone explains what is the best way of splitting RTE content text in 2 seperate div container ?
Since am working with a very long text container we would like to trim 0-450 characters in one div container and from 451 - 950 in another div container.
This is how my razor file looks like atm
Any suggestions on how to get this working ?
Pretty hard to split HTML in 2 equal parts, but one thing is for sure: Substring won't be your friend here ;-)
What's your browser requirement? Because you could easily achieve this with CSS columns (browser support). See here for introduction.
In case you need to split it without CSS, you will need a RegEx or parse the entire HTML (I would prefer RegEx).
The problem with both solutions is, that it's pretty impossible to split exactly it char 450, because this char could be a tag itself?! Or it could be text within a tag. So if you split it, you will have to close the tag and re-open it in the next part again.
That's why I think CSS columns are the best solution here, as the browser can handle it itself.
Hi Tobias,
True splitting those RTE content not very handy and practical. But yes i will give a try to css columns the only thing is IE not supporting it properly.
Thanks,
is working on a reply...